#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int n = 0;
	int i = 0;
	int j = 0;
	int a = -1;
	scanf("%d", &n);
	for (i = 1;i < n;i++)
	{
		for (j=0;j<n-i;j++)
		{
			printf(" ");
		}
		for (j=1;j<=i;j++)
		{
			printf("%d",j);
		}
		j--;
		j--;
		for (j;j>=1;--j)
		{
			printf("%d", j);
		}
		printf("\n");
	}
	for (j=1;j<=n;j++)
		{
			printf("%d", j);
		}
	j--;
	j--;
	for (j;j>=1;--j)
	{
		printf("%d", j);
	}
	printf("\n");
	for (i = 1;i < n;i++)
	{
		a = i;
		for (j=1;j<=a;j++)
		{
			printf(" ");
		}
		for (j=1;j<=n-i;j++)
		{
			printf("%d",j);
		}
		j--;
		j--;
		for (j;j>=1;--j)
		{
			printf("%d", j);
		}
		printf("\n");
	}
	
	return 0;
}